<template>
	<u-swiper :list="swipeList" :interval="autoplay" :showTitle="showTitle" :height="height" indicator
		:imgMode="imgMode" indicatorMode="dot" circular keyName="img" @click="onClick"></u-swiper>
</template>

<script>
	export default {
		name: 'DkMinSwiperImage',
		props: {
			height: {
				default: '',
				type: [Number, String],
			},
			autoplay: {
				default: 3000,
				type: [Number, String],
			},
			swipeList: {
				default: () => [],
				type: [Array],
			},
			imgMode: {
				default: 'aspectFill',
				type: String,
			},
			showTitle: {
				default: false,
				type: Boolean
			}
		},
		data() {
			return {}
		},
		methods: {
			onClick(index) {
				if (this.swipeList[index].url) {
					uni.navigateTo({
						url: this.swipeList[index].url
					});
				}
			}
		},
	}
</script>